package com.kotlin.myapplication.utils;

import android.os.Bundle;
import android.widget.DatePicker;

import com.kotlin.myapplication.R;

import java.util.Calendar;

import androidx.appcompat.app.AppCompatActivity;

/**
 * @lil
 * @创建时间 2019/10/30 15:54
 * @描述
 */
public class test extends AppCompatActivity {

    DatePicker datePicker;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void init() {
        Calendar c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int date = c.get(Calendar.DATE);
        datePicker = findViewById(R.id.datePicker);
        datePicker.init(year, month, date, new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
            }
        });
    }

}
